#ifndef JANUSPEERCONNECTION_H
#define JANUSPEERCONNECTION_H

#include <QObject>
#include <QJsonObject>
class Signaling;

class JanusPeerConnection : public QObject
{
    Q_OBJECT
public:
    explicit JanusPeerConnection(Signaling* pSignalHelper, const QString& strOpaqueID, QObject *parent = nullptr);
    virtual ~JanusPeerConnection();

    void attachVideoRoom();
    void onAttachVideoRoom(const QJsonObject& recvData);

    void sendSDP(const QString& strSDP, const QString& strType);
    void onSendSDP(const QJsonObject& recvData);

    void sendCandidate(const QString& strSDPMid, const int& iSDPMLineIndex, const QString& strCandidate);
    void onSendCandidate(const QJsonObject& recvData);

    qint64 getHandleID();

    bool isSubscribe();

    void setSubscribe(const qint16& id);
    qint64 getSubscribe();

    void setPrivateID(const qint64& id);

private:
    void detachVideoRoom();
    void onDetachVideoRoom(const QJsonObject& recvData);


Q_SIGNALS:

private:
    Signaling       *m_pSignalHelper;
    QString         m_strOpaqueID;      // 暂时未知作用
    qint64          m_handleID;         // peer id
    qint64          m_subscribeID;      // 暂时未知作用
    qint64          m_privateID;        // 暂时未知作用

};

#endif // JANUSPEERCONNECTION_H
